/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AboutDialog.java
 *
 * Created on 29-Mar-2009, 16:52:42
 */

package edu.napier.soc.xfdm.uci;

import edu.napier.soc.xfdm.launcher.*;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.WindowConstants;

/**
 *
 * @author Thomas
 */
public class AboutDialog extends javax.swing.JDialog {

    /** Creates new form AboutDialog */
    public AboutDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
		setLocationRelativeTo(parent);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
		GridBagConstraints gridBagConstraints;

        splashIcon = new JLabel();
        closeButton = new JButton();
        informationPanel = new JPanel();
        versionaLabel = new JLabel();
        versionbLabel = new JLabel();
        developeraLabel = new JLabel();
        developerbLabel = new JLabel();
        emailaLabel = new JLabel();
        emailbLabel = new JLabel();

        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("About");
        setResizable(false);
        getContentPane().setLayout(new GridBagLayout());

        splashIcon.setHorizontalAlignment(SwingConstants.CENTER);
        splashIcon.setIcon(new ImageIcon(getClass().getResource("/edu/napier/soc/xfdm/resources/logo.png"))); // NOI18N
        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = GridBagConstraints.BOTH;
        getContentPane().add(splashIcon, gridBagConstraints);

        closeButton.setText("Close");
        closeButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                closeButtonActionPerformed(evt);
            }
        });
        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new Insets(5, 0, 5, 0);
        getContentPane().add(closeButton, gridBagConstraints);

        informationPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        informationPanel.setLayout(new GridLayout(3, 2, 5, 3));

        versionaLabel.setHorizontalAlignment(SwingConstants.RIGHT);
        versionaLabel.setText("Version:");
        informationPanel.add(versionaLabel);

        versionbLabel.setText(ApplicationInfo.VERSION);
        informationPanel.add(versionbLabel);

        developeraLabel.setHorizontalAlignment(SwingConstants.RIGHT);
        developeraLabel.setText("Developer:");
        informationPanel.add(developeraLabel);

        developerbLabel.setText(ApplicationInfo.DEVELOPER);
        informationPanel.add(developerbLabel);

        emailaLabel.setHorizontalAlignment(SwingConstants.RIGHT);
        emailaLabel.setText("Email:");
        informationPanel.add(emailaLabel);

        emailbLabel.setText(ApplicationInfo.EMAIL);
        informationPanel.add(emailbLabel);

        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = GridBagConstraints.BOTH;
        gridBagConstraints.weighty = 1.0;
        getContentPane().add(informationPanel, gridBagConstraints);

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void closeButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
		dispose();
}//GEN-LAST:event_closeButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private JButton closeButton;
    private JLabel developeraLabel;
    private JLabel developerbLabel;
    private JLabel emailaLabel;
    private JLabel emailbLabel;
    private JPanel informationPanel;
    private JLabel splashIcon;
    private JLabel versionaLabel;
    private JLabel versionbLabel;
    // End of variables declaration//GEN-END:variables

}
